import React from 'react'
import ReactDOM from 'react-dom'
import { AppContainer } from 'react-hot-loader'
// import { Provider } from 'react-redux'
import { MuiThemeProvider } from 'material-ui'
import getMuiTheme from 'material-ui/styles/getMuiTheme'
import Router from './router'

const muiTheme = getMuiTheme({
  palette: {
    primary1Color: '#E20000'
  }
})

const render = Component => {
  ReactDOM.render(
    <AppContainer>
      {/* <Provider> */}
        <MuiThemeProvider muiTheme={muiTheme}>
          <Component />
        </MuiThemeProvider>
      {/* </Provider> */}
    </AppContainer>,
    document.getElementById('app'),
  )
}

render(Router)

if (module.hot) {
  module.hot.accept('./router', () => render(Router))
}
